﻿using System;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using DTO;
using BusinessLayer.Logic.UserLogic;
using ModelLayer;
using BusinessLayer;
using log4net;
using System.Collections.Generic;
using System.Web;

namespace AssessmentTool.Web
{
    [ServiceContract(Namespace = "")]
    [SilverlightFaultBehavior]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class ModelloService
    {
        private static readonly ILog log = LogManager.GetLogger(
                   System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        [OperationContract]
        public Modello getModelloFromUtente(DTOUtente utente)
        {
            try
            {
                return new ModelloLogic().getModelloConRisposteUtente(utente);
            }
            catch (Exception e)
            {
                log.Error("Errore nella chiamata", e);
                throw e;
            }
        }
        [OperationContract]
        public Dictionary<String,String> getDictionary(String lingua)
        {
            
            try
            {
                return new ModelloLogic().getDictionary(lingua);
            }
            catch (Exception e)
            {
                log.Error("Errore nella chiamata", e);
                throw e;
            }
        }
    

        // Add more operations here and mark them with [OperationContract]
    }
}
